document.getElementById('loginForm').addEventListener('submit', function (e) {
  e.preventDefault();
  const username = document.getElementById('username').value;
  const password = document.getElementById('password').value;

  // 简单验证，实际应与后端交互
  if (username === 'admin' && password === 'password') {
    window.location.href = 'dashboard.html';
  } else {
    document.getElementById('error-message').textContent = '用户名或密码错误';
  }
});